TAG = ./bin/led.bin
ASM = ./src/led.s
OBJ = ./build/led.o
ELF = ./build/led.elf
BIN = ./bin/led.bin
ARM_GCC = arm-linux-gnueabihf-gcc
ARM_LD = arm-linux-gnueabihf-ld 
ARM_ELF2BIN = arm-linux-gnueabihf-objcopy
COM_PAR = -g -c
LD_PAR =  -Ttext 0X87800000
TRA_PAR = -O binary -S -g
SD = /dev/sdb

$(TAG):$(ASM)
	$(ARM_GCC) $(COM_PAR) $(ASM) -o $(OBJ)
	$(ARM_LD) $(LD_PAR) $(OBJ) -o $(ELF)
	$(ARM_ELF2BIN) $(TRA_PAR) $(ELF) $(BIN)
load:
	./imxdownload $(TAG) $(SD)
clean:
	rm ./bin/*
